<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册</title>
<style type="text/css">
.ys01 {	font-size: 24px;
}
.ys01 {	font-size: 36px;
}
.ys01 {	font-size: 14px;
}
.ys01 {	font-size: 12px;
}
.ys03 {	font-size: 24px;
	font-weight: bold;
}
.ys10 {
	text-align: right;
}
.ys10 {
	font-size: 24px;
	text-align: center;
}
.ys11 {
	font-size: 12px;
}
.ys12 {
	font-size: 12px;
}
</style>
</head>

<body>
<table width="100%" border="0">
  <tr>
    <th height="750" scope="col"><table width="1050" border="0">
      <tr>
        <th scope="col"><table width="1000" border="0" align="center">
          <tr>
            <th width="25%" height="80" scope="col"><table width="20%" border="0" align="left">
              <tr>
                <th scope="col"><img src="logo.jpg" width="90" height="60" alt="logo" /></th>
              </tr>
            </table></th>
          </tr>
        </table></th>
      </tr>
      <tr>
        <th scope="row"><table width="100%" border="0">
          <tr>
            <th height="500" bgcolor="#99FFCC" scope="col"><table border="0" align="right">
              <tr>
                <th width="300" bgcolor="#FFFFFF" scope="col"><table width="100%" border="0" align="center">
                  <tr>
                    <th width="300" height="50" scope="col">新用户注册</th>
                  </tr>
                  <tr>
                    <th width="300" height="30" scope="row"><label for="username"></label>
                      <input name="username" type="text" id="username" placeholder="建议使用手机号或邮箱" size="30" /></th>
                  </tr>
                  <tr>
                    <th width="300" height="30" scope="row"><div id="embed-captcha" class="marginbt10 clearfix"></div>
                      <p id="wait" class="show">正在加载验证码......</p>
                      <p id="notice" class="none">请先拖动验证码到相应位置</p></th>
                  </tr>
                  <tr>
                    <th width="300" height="30" scope="row"><label for="introcode"></label>
                      <input name="introcode" type="text" id="introcode" placeholder="introcode" size="30" /></th>
                  </tr>
                  <tr>
                    <th width="300" height="30" scope="row"><input name="password" type="password" id="password" placeholder="请输入6-16位密码" size="30" /></th>
                  </tr>
                  <tr>
                    <th width="300" height="30" scope="row"><input name="password_qr" type="password" id="password_qr" placeholder="请确认密码" size="30" /></th>
                  </tr>
                  <tr>
                    <th width="300" height="60" bgcolor="#FF6633" class="ys11" scope="row" id="submit"><span class="ys10" >确认</span></th>
                  </tr>
                  <tr>
                    <th width="300" height="30" class="ys12" scope="row">已有账号？现在就登录</th>
                  </tr>
                </table></th>
                <th width="100" scope="col">&nbsp;</th>
              </tr>
            </table></th>
          </tr>
        </table></th>
      </tr>
      <tr>
        <th scope="row"><table width="1000" border="0" align="center">
          <tr>
            <th width="18%" height="200" scope="col"><table width="100%" border="0">
              <tr>
                <th height="30" class="ys03" scope="col">用户帮助</th>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
              </tr>
            </table>
              <table width="100%" border="0">
                <tr>
                  <th scope="col">入住指南</th>
                </tr>
                <tr>
                  <th scope="row">生活常识</th>
                </tr>
                <tr>
                  <th scope="row">常见问题</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
              </table></th>
            <th width="18%" height="200" scope="col"><table width="100%" border="0">
              <tr>
                <th height="30" class="ys03" scope="col">商务合作</th>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
              </tr>
            </table>
              <table width="100%" border="0">
                <tr>
                  <th scope="col">商务合作</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
              </table></th>
            <th width="18%" height="200" scope="col"><table width="100%" border="0">
              <tr>
                <th height="30" class="ys03" scope="col">公司信息</th>
              </tr>
              <tr>
                <th scope="row">&nbsp;</th>
              </tr>
            </table>
              <table width="100%" border="0">
                <tr>
                  <th scope="col">关于我们</th>
                </tr>
                <tr>
                  <th scope="row">联系我们</th>
                </tr>
                <tr>
                  <th scope="row">加入我们</th>
                </tr>
                <tr>
                  <th scope="row">&nbsp;</th>
                </tr>
              </table></th>
            <th width="18%" height="200" scope="col"><table width="100%" border="0">
              <tr>
                <th height="30" class="ys03" scope="col">客服热线</th>
              </tr>
              <tr>
                <th scope="row"><table width="100%" border="0">
                  <tr>
                    <th scope="col">0311-5555555</th>
                  </tr>
                  <tr>
                    <th scope="row">工作日 09:00-21:00</th>
                  </tr>
                  <tr>
                    <th scope="row">&nbsp;</th>
                  </tr>
                  <tr>
                    <th scope="row">&nbsp;</th>
                  </tr>
                </table></th>
              </tr>
            </table></th>
            <th height="200" scope="col"><table width="100%" border="1">
              <tr>
                <th scope="col">APP二维码</th>
                <th scope="col">公众号二维码</th>
              </tr>
            </table></th>
          </tr>
        </table></th>
      </tr>
      <tr>
        <th scope="row"><table width="1000" border="0" align="center">
          <tr>
            <th width="20%" height="80" scope="col"><img src="logo.jpg" width="90" height="60" alt="logo" /></th>
            <th height="80" scope="col"><table width="90%" border="0">
              <tr>
                <th class="ys01" scope="col">寓萌——公寓&amp;中介完美合作平台</th>
              </tr>
              <tr>
                <th class="ys01" scope="row">本网站所有页面的数据统计均来源于寓萌数据库   联系客服：微信 周一至周日09:00-22:00</th>
              </tr>
            </table></th>
            <th width="15%" height="80" scope="col"><img src="标志.png" width="90" height="60" alt="标志" /></th>
          </tr>
        </table></th>
      </tr>
    </table></th>
  </tr>
</table>
</body>
</html>
<link rel="stylesheet" href="../layui/css/layui.css">
<script src="../layui/layui.js"></script>
<script src="../js/jquery-3.2.1.min.js"></script>
<script src="../gt3-php-sdk-master/static/gt.js"></script>
<script>
              layui.use('layer', function(){
                layer = layui.layer;
                console.log(layer);
              });   
  var handlerEmbed1 = function (captchaObj) {
				$("#submit").click(function (e) {
				    var validate = captchaObj.getValidate();
				    if (!validate) {
				        $("#notice")[0].className = "show";
				        setTimeout(function () {
				            $("#notice")[0].className = "hide";
				        }, 2000);
				        e.preventDefault();
				    }else{
				    	var username=$("#username").val();
              var password=$("#password").val();
              var password_qr=$("#password_qr").val();
              var introcode=$("#introcode").val();
              if(!username){
                layer.msg("用户名必须填写！");
              }
              if(!password || !password_qr){
                layer.msg("密码与确认密码必须填写！");
                return;
              }
              if(password!=password_qr){
                layer.msg("两次输入的密码不一致。");
                return;
              }
				    	var formdata1=new FormData();
              formdata1.append("username",username);
              formdata1.append("password",password);
              formdata1.append("introcode",introcode);
              formdata1.append("type","reg");
				    	// formdata1.append("pc",1);
				    	$.ajax({
				    		url: '../php/api.php',
				    		type: 'post',
				    		dataType: 'json',
				    		processData: false,
    						contentType: false,
				    		data: formdata1,
				    	})
				    	.done(function(msg) {
				    		if(msg.state==1){
				    			window.location.href="../index.php";
				    		}
				    	})
				    	.fail(function() {
				    		console.log("error");
				    	})
				    	.always(function() {
				    		console.log("complete");
				    	});

				    }
				});
				// 将验证码加到id为captcha的元素里，同时会有三个input的值：geetest_challenge, geetest_validate, geetest_seccode
				captchaObj.appendTo("#embed-captcha");
				captchaObj.onReady(function () {
				    $("#wait")[0].className = "hide";
				});
	    	};
        $.ajax({
		        // 获取id，challenge，success（是否启用failback）
		        url: "../gt3-php-sdk-master/web/StartCaptchaServlet.php?t=" + (new Date()).getTime(), // 加随机数防止缓存
		        type: "get",
		        dataType: "json",
		        success: function (data) {
		            console.log(data);
		            // 使用initGeetest接口
		            // 参数1：配置参数
		            // 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
		            initGeetest({
		                gt: data.gt,
		                width: '100%',
		                challenge: data.challenge,
		                new_captcha: data.new_captcha,
		                product: "embed", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
		                offline: !data.success // 表示用户后台检测极验服务器是否宕机，一般不需要关注
		                // 更多配置参数请参见：http://www.geetest.com/install/sections/idx-client-sdk.html#config
		            }, handlerEmbed1);
		        }
		    });
</script>
<style>
  #embed-captcha ,#embed-captcha1{
		    width: 100%;
		    margin: 0 auto 20px;
		}
		.show {
		    display: block;
		}
		.hide,.none {
		    display: none;
		}
		#notice {
		    color: red;
		}
		.geetest_holder.geetest_wind{
			min-width: 200px;
		}
</style>
